/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.com.sysaut.seguridad.domain;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 *
 * @author ytorres
 */
@Entity
@Table(name = "tcargo")
public class Tcargo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_cargo")
    private String idCargo;
    @Basic(optional = false)
    @Column(name = "nom_cargo")
    private String nomCargo;
//    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tcargo")
//    private List<Tusuario> tusuarioList;

    public Tcargo() {
    }

    public Tcargo(String idCargo) {
        this.idCargo = idCargo;
    }

    public Tcargo(String idCargo, String nomCargo) {
        this.idCargo = idCargo;
        this.nomCargo = nomCargo;
    }

    public String getIdCargo() {
        return idCargo;
    }

    public void setIdCargo(String idCargo) {
        this.idCargo = idCargo;
    }

    public String getNomCargo() {
        return nomCargo;
    }

    public void setNomCargo(String nomCargo) {
        this.nomCargo = nomCargo;
    }

//    @XmlTransient
//    public List<Tusuario> getTusuarioList() {
//        return tusuarioList;
//    }
//
//    public void setTusuarioList(List<Tusuario> tusuarioList) {
//        this.tusuarioList = tusuarioList;
//    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCargo != null ? idCargo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tcargo)) {
            return false;
        }
        Tcargo other = (Tcargo) object;
        if ((this.idCargo == null && other.idCargo != null) || (this.idCargo != null && !this.idCargo.equals(other.idCargo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "appdomain.Tcargo[ idCargo=" + idCargo + " ]";
    }
    
}
